package com.xinzhu;

import com.xinzhu.producer.Producer;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.HashMap;
import java.util.Map;

@RunWith(value = SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
        "classpath:/rabbitMq.xml"})
public class Test {

    @Autowired
    Producer producer;

    final String queue_key = "test_queue_key";

@org.junit.Test
    public void send() {
        Map<String, Object> msg = new HashMap();
        msg.put("data", "hello,rabbmitmq!");
        producer.sendQueue("test-mq-exchange", "test_queue_key", msg);
    }
}
